Optimal. Leaf size=219 \[ -\frac{b \left (a^2 A-2 a b B+3 A b^2\right )}{a^2 d \left (a^2+b^2\right ) \sqrt{a+b \tan (c+d x)}}+\frac{(3 A b-2 a B) \tanh ^{-1}\left (\frac{\sqrt{a+b \tan (c+d x)}}{\sqrt{a}}\right )}{a^{5/2} d}+\frac{(B+i A) \tanh ^{-1}\left (\frac{\sqrt{a+b \tan (c+d x)}}{\sqrt{a-i b}}\right )}{d (a-i b)^{3/2}}-\frac{(-B+i A) \tanh ^{-1}\left (\frac{\sqrt{a+b \tan (c+d x)}}{\sqrt{a+i b}}\right )}{d (a+i b)^{3/2}}-\frac{A \cot (c+d x)}{a d \sqrt{a+b \tan (c+d x)}} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.857862, antiderivative size = 219, normalized size of antiderivative = 1., number of steps used = 13, number of rules used = 8, integrand size = 33, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.242, Rules used = {3609, 3649, 3653, 3539, 3537, 63, 208, 3634} \[ -\frac{b \left (a^2 A-2 a b B+3 A b^2\right )}{a^2 d \left (a^2+b^2\right ) \sqrt{a+b \tan (c+d x)}}+\frac{(3 A b-2 a B) \tanh ^{-1}\left (\frac{\sqrt{a+b \tan (c+d x)}}{\sqrt{a}}\right )}{a^{5/2} d}+\frac{(B+i A) \tanh ^{-1}\left (\frac{\sqrt{a+b \tan (c+d x)}}{\sqrt{a-i b}}\right )}{d (a-i b)^{3/2}}-\frac{(-B+i A) \tanh ^{-1}\left (\frac{\sqrt{a+b \tan (c+d x)}}{\sqrt{a+i b}}\right )}{d (a+i b)^{3/2}}-\frac{A \cot (c+d x)}{a d \sqrt{a+b \tan (c+d x)}} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3609
Rule 3649
Rule 3653
Rule 3539
Rule 3537
Rule 63
Rule 208
Rule 3634
Rubi steps
\begin{align*} \int \frac{\cot ^2(c+d x) (A+B \tan (c+d x))}{(a+b \tan (c+d x))^{3/2}} \, dx &=-\frac{A \cot (c+d x)}{a d \sqrt{a+b \tan (c+d x)}}-\frac{\int \frac{\cot (c+d x) \left (\frac{1}{2} (3 A b-2 a B)+a A \tan (c+d x)+\frac{3}{2} A b \tan ^2(c+d x)\right )}{(a+b \tan (c+d x))^{3/2}} \, dx}{a}\\ &=-\frac{b \left (a^2 A+3 A b^2-2 a b B\right )}{a^2 \left (a^2+b^2\right ) d \sqrt{a+b \tan (c+d x)}}-\frac{A \cot (c+d x)}{a d \sqrt{a+b \tan (c+d x)}}-\frac{2 \int \frac{\cot (c+d x) \left (\frac{1}{4} \left (a^2+b^2\right ) (3 A b-2 a B)+\frac{1}{2} a^2 (a A+b B) \tan (c+d x)+\frac{1}{4} b \left (a^2 A+3 A b^2-2 a b B\right ) \tan ^2(c+d x)\right )}{\sqrt{a+b \tan (c+d x)}} \, dx}{a^2 \left (a^2+b^2\right )}\\ &=-\frac{b \left (a^2 A+3 A b^2-2 a b B\right )}{a^2 \left (a^2+b^2\right ) d \sqrt{a+b \tan (c+d x)}}-\frac{A \cot (c+d x)}{a d \sqrt{a+b \tan (c+d x)}}-\frac{2 \int \frac{\frac{1}{2} a^2 (a A+b B)-\frac{1}{2} a^2 (A b-a B) \tan (c+d x)}{\sqrt{a+b \tan (c+d x)}} \, dx}{a^2 \left (a^2+b^2\right )}-\frac{(3 A b-2 a B) \int \frac{\cot (c+d x) \left (1+\tan ^2(c+d x)\right )}{\sqrt{a+b \tan (c+d x)}} \, dx}{2 a^2}\\ &=-\frac{b \left (a^2 A+3 A b^2-2 a b B\right )}{a^2 \left (a^2+b^2\right ) d \sqrt{a+b \tan (c+d x)}}-\frac{A \cot (c+d x)}{a d \sqrt{a+b \tan (c+d x)}}-\frac{(A-i B) \int \frac{1+i \tan (c+d x)}{\sqrt{a+b \tan (c+d x)}} \, dx}{2 (a-i b)}-\frac{(A+i B) \int \frac{1-i \tan (c+d x)}{\sqrt{a+b \tan (c+d x)}} \, dx}{2 (a+i b)}-\frac{(3 A b-2 a B) \operatorname{Subst}\left (\int \frac{1}{x \sqrt{a+b x}} \, dx,x,\tan (c+d x)\right )}{2 a^2 d}\\ &=-\frac{b \left (a^2 A+3 A b^2-2 a b B\right )}{a^2 \left (a^2+b^2\right ) d \sqrt{a+b \tan (c+d x)}}-\frac{A \cot (c+d x)}{a d \sqrt{a+b \tan (c+d x)}}+\frac{(i (A+i B)) \operatorname{Subst}\left (\int \frac{1}{(-1+x) \sqrt{a+i b x}} \, dx,x,-i \tan (c+d x)\right )}{2 (a+i b) d}-\frac{(i A+B) \operatorname{Subst}\left (\int \frac{1}{(-1+x) \sqrt{a-i b x}} \, dx,x,i \tan (c+d x)\right )}{2 (a-i b) d}-\frac{(3 A b-2 a B) \operatorname{Subst}\left (\int \frac{1}{-\frac{a}{b}+\frac{x^2}{b}} \, dx,x,\sqrt{a+b \tan (c+d x)}\right )}{a^2 b d}\\ &=\frac{(3 A b-2 a B) \tanh ^{-1}\left (\frac{\sqrt{a+b \tan (c+d x)}}{\sqrt{a}}\right )}{a^{5/2} d}-\frac{b \left (a^2 A+3 A b^2-2 a b B\right )}{a^2 \left (a^2+b^2\right ) d \sqrt{a+b \tan (c+d x)}}-\frac{A \cot (c+d x)}{a d \sqrt{a+b \tan (c+d x)}}+\frac{(A-i B) \operatorname{Subst}\left (\int \frac{1}{-1-\frac{i a}{b}+\frac{i x^2}{b}} \, dx,x,\sqrt{a+b \tan (c+d x)}\right )}{(a-i b) b d}+\frac{(A+i B) \operatorname{Subst}\left (\int \frac{1}{-1+\frac{i a}{b}-\frac{i x^2}{b}} \, dx,x,\sqrt{a+b \tan (c+d x)}\right )}{(a+i b) b d}\\ &=\frac{(3 A b-2 a B) \tanh ^{-1}\left (\frac{\sqrt{a+b \tan (c+d x)}}{\sqrt{a}}\right )}{a^{5/2} d}+\frac{(i A+B) \tanh ^{-1}\left (\frac{\sqrt{a+b \tan (c+d x)}}{\sqrt{a-i b}}\right )}{(a-i b)^{3/2} d}-\frac{(i A-B) \tanh ^{-1}\left (\frac{\sqrt{a+b \tan (c+d x)}}{\sqrt{a+i b}}\right )}{(a+i b)^{3/2} d}-\frac{b \left (a^2 A+3 A b^2-2 a b B\right )}{a^2 \left (a^2+b^2\right ) d \sqrt{a+b \tan (c+d x)}}-\frac{A \cot (c+d x)}{a d \sqrt{a+b \tan (c+d x)}}\\ \end{align*}
Mathematica [A] time = 3.56799, size = 208, normalized size = 0.95 \[ \frac{-\frac{b \left (a^2 A-2 a b B+3 A b^2\right )}{\left (a^2+b^2\right ) \sqrt{a+b \tan (c+d x)}}+a^2 \left (\frac{(B+i A) \tanh ^{-1}\left (\frac{\sqrt{a+b \tan (c+d x)}}{\sqrt{a-i b}}\right )}{(a-i b)^{3/2}}+\frac{(B-i A) \tanh ^{-1}\left (\frac{\sqrt{a+b \tan (c+d x)}}{\sqrt{a+i b}}\right )}{(a+i b)^{3/2}}\right )+\frac{(3 A b-2 a B) \tanh ^{-1}\left (\frac{\sqrt{a+b \tan (c+d x)}}{\sqrt{a}}\right )}{\sqrt{a}}-\frac{a A \cot (c+d x)}{\sqrt{a+b \tan (c+d x)}}}{a^2 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [C] time = 2.865, size = 119757, normalized size = 546.8 \begin{align*} \text{output too large to display} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\left (A + B \tan{\left (c + d x \right )}\right ) \cot ^{2}{\left (c + d x \right )}}{\left (a + b \tan{\left (c + d x \right )}\right )^{\frac{3}{2}}}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{{\left (B \tan \left (d x + c\right ) + A\right )} \cot \left (d x + c\right )^{2}}{{\left (b \tan \left (d x + c\right ) + a\right )}^{\frac{3}{2}}}\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]